Dashboard

Column

Barplot

Volcanoplot

Table

Summary

   Feature                Type        Value         Statistic        
 Length:32          Shuffled:16   Min.   :  5.20   Length:32         
 Class :character   True    :16   1st Qu.: 15.46   Class :character  
 Mode  :character                 Median : 29.61   Mode  :character  
                                  Mean   : 63.19                     
                                  3rd Qu.: 68.25                     
                                  Max.   :309.08                     
    Variance           Pval_1           Pval_2            Neg_binom      
 Min.   : 0.9695   Min.   :0.04308   Length:32          Min.   :0.03126  
 1st Qu.: 1.4430   1st Qu.:0.16120   Class :character   1st Qu.:0.42468  
 Median : 3.7331   Median :0.19960   Mode  :character   Median :0.66080  
 Mean   :13.8016   Mean   :0.21008                      Mean   :0.52840  
 3rd Qu.: 6.9116   3rd Qu.:0.28192                      3rd Qu.:0.72267  
 Max.   :81.9445   Max.   :0.32420                      Max.   :0.79596  
---
title: "Web-OLOGRAM"
output: 
  flexdashboard::flex_dashboard:
    source_code: embed
    orientaion: columns
    theme: bootstrap
params:
  barplot_table: NULL
  volcano_table: NULL
---

```{css}
.chart-shim {
  overflow: auto;
}
```
    
```{r global, include = FALSE}
knitr::opts_chunk$set(echo = FALSE)
#--------------------------------------------------------------
# Load libraries
#--------------------------------------------------------------

# library(shiny)
library(reshape2)
library(ggplot2)
library(dplyr)
library(ggrepel)
library(ggthemes)
library(shinythemes)
library(optparse)
library(plotly)
library(DT)
library(crosstalk)
library(htmltools)
head(params$barplot_table)

```

Dashboard 
=======================================================================

Inputs {.sidebar}
-----------------------------------------------------------------------

### Inputs

```{r}
sd_barplot_table <- SharedData$new(params$barplot_table)
sd_volcano_table <- SharedData$new(params$volcano_table)

filter_slider("value", "Value", sd_barplot_table, column=~Value, step=1000)

```

Column {.tabset}
-----------------------------------------------------------------------

### Barplot 

```{r}
bar <- ggplot(sd_barplot_table, mapping=aes(x=Feature, y=Value, fill=Type)) + 
         geom_bar(stat="identity", position = "dodge") 
bar_ly <- ggplotly(bar)
bscols(bar_ly,device = c("xs", "sm", "md", "lg"))
```

### Volcanoplot

```{r}
volcano <-  ggplot(params$volcano_table, 
           mapping=aes(x=.data[['log2(FC)']],
                      y=.data[['-log10(pvalue)']],
                      color=.data[['Statistic']],
                      label=.data[['Feature']])) +
      geom_vline(xintercept = 0,
                 size=0.5) +
      geom_hline(yintercept = 0,
                 size=0.5) +
      geom_point() +
      geom_label()
volcano_y <- ggplotly(volcano)
volcano_y

```

### Table 

```{r}
DT::datatable(params$barplot_table,
              options = list(bPaginate = FALSE))
```

### Summary 

```{r}
summary(params$barplot_table)
```